@import './element-variables';
@import './epm-variables';

/* 官方element组件二次改造
   ----------------
   | versions.1.7 |
   | 2019/08/06   |
   | EPM体验设计部 |
   ----------------

    1. 参照 Axure EPM-基础样式库1.6 版本设计;
    2. 部分ElementUI组件的UI样式根据版本迭代;
    3. 深度改造ElementUI组件且无破坏性参数，您依然可以使用官网提供的API;
    4. 此版本针对ElementUI组件符合业务的第一层改造，个性化需求不建议在此文件处修改;
    5. 更换主题请新建修改并关联新主题变量表和官方在线主题工具;
-------------------------------------------------------------------------*/


/* Button
-------------------------- */
.el-button {
  min-width: 90px;

  &.el-button--small {
    border-radius: 3px; // 大量按钮的设计都为size="small"，需修改圆角大小
  }

  &--primary {
    // 修改了danger类型按钮样式
    background-color: $--color-primary;
    border-color: $--color-primary;
    color: $--color-white;

    &:hover,
    &:visited {
      background-color: $--color-primary-hover;
      border-color: $--color-primary-hover;
      color: $--color-white;
    }

    &:active,
    &:focus {
      background-color: $--color-primary-focus;
      border-color: $--color-primary-focus;
      color: $--color-white;
    }

    &.is-plain {
      // 修改了danger类型按钮样式
      background-color: $--color-white;
      border-color: $--color-primary;
      color: $--color-primary;

      &:hover,
      &:active,
      &:focus,
      &:visited {
        background-color: $--color-primary;
        border-color: $--color-primary;
        color: $--color-white;
      }
    }
  }

  &--success {
    &.is-plain {
      background: $--color-white;
      border-color: $--color-success;
      color: $--color-success;

      &:hover,
      &:active,
      &:focus,
      &:visited {
        background-color: $--color-success;
        border-color: $--color-success;
        color: $--color-white;
      }
    }
  }

  &--danger {
    // 修改了danger类型按钮样式
    background-color: $--color-grayish-1;
    border-color: $--border-color-base;
    color: $--color-danger;

    &:hover,
    &:active,
    &:focus,
    &:visited {
      background-color: $--color-danger-hover;
      border-color: $--color-danger-foucs;
      color: $--color-white;
    }

    &.is-disabled {
      background-color: $--border-color-base;
      border-color: $--border-color-base;
      color: $--color-danger;

      &:hover {
        background-color: $--border-color-base;
        border-color: $--border-color-base;
        color: $--color-danger;
      }
    }

    &.el-button--text {
      color: $--color-danger;
    }
  }

  &--text,
  &--mini {
    min-width: auto;
  }
}

/* Tag
-------------------------- */
.el-tag {
  &--medium {
    height: 28px;
    line-height: 26px;
  }

  &--small {
    height: 28px;
    line-height: 26px;
  }

  &--mini {
    height: 24px;
    line-height: 22px;
  }
}

.el-tag+.el-tag {
  margin-left: 10px;
}

.el-tag+.el-input {
  width: 90px;
  margin-left: 10px;
  vertical-align: bottom;

  .el-input__inner {
    height: 24px;
    line-height: 22px;
  }
}

.el-tag+.el-button {
  margin-left: 10px;
  padding: unset;
  height: 24px;
  line-height: 22px;
  min-width: 24px;
  background-color: $--color-success-4;
  border-color: $--color-success-5;
  color: $--color-success-1;
}

/* Tabs
-------------------------- */
.el-tabs {
  &__item {
    &.is-left {
      &.is-active {
        background-color: $--color-primary-5;
      }
    }
  }

  &__nav-wrap {
    &::after {
      height: 0;
    }
  }

  &__active-bar {
    height: 1px;

  }

  &.large {
    .el-tabs__item {
      font-size: 16px;
    }
  }

  &.small {
    .el-tabs__item {
      font-size: 12px;
    }
  }
}


/* Steps
-------------------------- */
.el-steps {
  max-width: 45%;
  border-radius: 50px;
  padding: 0;
  background-color: $--color-primary-5;

  .el-step {
    flex-basis: calc(33.333% + 20px) !important;
    margin-left: -20px;
    height: 30px;

    &__description {
      margin-top: 0;
    }

    &:first-child {
      margin-left: 0;

      .el-step__title {
        border-radius: 50px;
      }
    }

    &__head,
    &__arrow {
      display: none;
      flex-grow: 0;
    }

    &__main {
      display: block;
      text-align: center;
    }

    &.is-flex {
      flex-basis: 33.3333% !important;
    }

    &__title {
      float: left;
      max-width: 100% !important;
      width: 100%;
      border-radius: 50px;
      line-height: 30px;
      font-size: 14px;
      color: $--color-text-primary;
      font-weight: normal;

      &.is-process {
        background-color: $--color-primary;
        color: $--color-white;
      }
    }
  }
}

/* Table
-------------------------- */
.el-table {
  font-size: 12px;
  border-collapse: collapse;

  &--border {
    border: 1px solid $--border-color-lighter;
    border-top: 0;

    tr {
      td {
        &:last-child {
          border-right: 0 !important;
        }
      }
    }
  }

  &::before,
  .el-table__fixed-right::before,
  .el-table__fixed::before {
    height: 0;
  }

  &__header-wrapper {
    background-color: $--table-header-background-color; // 数据多时，出现滚动条后的bug
  }

  &__footer-wrapper {
    tbody td {
      color: $--color-primary;
    }
  }

  tr {
    height: 36px;

    .cell {
      line-height: 36px;
    }

    th {
      padding-top: 0;
      padding-bottom: 0;
      background-color: $--table-header-background-color;

      >.cell {
        color: $--color-text-grade-5;
        font-weight: normal;
      }
    }

    td {
      padding-top: 5px;
      padding-bottom: 5px;

      .el-button {
        min-width: auto;
      }

      .el-tag {
        margin-right: 4px;
      }

      .cell {
        line-height: 1.4;
      }
    }
  }

  // 表格内折叠内容
  &__expand-icon {
    .el-icon {
      &.el-icon-arrow-right:before {
        content: "\e791";
      }
    }
  }
}

/* Tree
-------------------------- */
.folder-style {
  padding: 20px 0;
  box-sizing: border-box;
  background-color: transparent !important;

  .tree-item {
    display: inline-block;

    .leaf {
      .item-label {
        width: 155px;
        display: inline-block;
        vertical-align: bottom;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }

  .catalog-label {
    width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .el-tree-node {
    &.is-current {
      background-color: $--color-primary-5;
      box-shadow: -2px 0 0 $--color-primary inset;
      color: $--color-primary;
    }

    &__label {
      font-size: 12px;
    }

    &__content {
      height: 30px;
      position: relative;

      &:hover,
      &:focus {
        background-color: $--color-primary-5;
        box-shadow: -2px 0 0 $--color-primary inset;

        .el-tree-node__operator {
          display: block;
        }
      }

      .el-checkbox {
        display: inline-block;
        margin-right: 12px;
        transform: translateY(-2px);
      }

      .el-icon-caret-right {
        font-family: "iconfont" !important;
        font-size: 16px;
        font-style: normal;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;

        &::before {
          display: inline-block;
          margin-right: 6px;
          content: "\e691";
          transform: scale(.75);
          color: #c9c9c9;
          font-size: 12px;
        }

        &::after {
          display: inline-block;
          margin-right: 2px;
          content: "\e693";
          color: #ffcd2c;
          font-size: 14px;
        }

        &.expanded {
          transform: rotate(0);

          &::before {
            content: "\e692";
          }

          &::after {
            margin-right: 0;
            content: "\e690";
          }
        }

        &.is-leaf {
          // padding-left: 14px !important;
          width: 0;

          &::before,
          &::after {
            content: '';
          }
        }
      }
    }

    // 自定义node时
    &__label {
      font-size: 12px;
    }

    // 自定义node时
    &__operator {
      display: none;
      position: absolute;
      left: 95%;
      top: 0;
      z-index: 999;
      padding: 2px 4px;
      background-color: $--layout-tabs-bg;
      border: 1px solid $--border-color-base;
      border-radius: 2px;
      box-shadow: 0 0 3px rgba($color: $--color-blue-deep-1, $alpha: .1);
      line-height: 1;

      >i {
        font-size: 12px;
        color: $--color-primary;
        margin: 0 2px;

        &.icon-delete2 {
          color: $--color-danger;
        }
      }
    }
  }

  >.el-tree-node {
    >.el-tree-node__content {
      padding-left: 14px !important;
    }

    .el-tree-node__children {
      overflow: visible !important;

      >.el-tree-node {
        padding-left: 14px !important;

      }
    }
  }

}

/* Pagination
-------------------------- */
.el-pagination {
  margin-top: 18px;
  text-align: right;
  font-size: 12px;

  &.is-background {

    >button,
    >span:not([class*=suffix]) {
      height: 24px;
      line-height: 24px;
    }

    >.el-pager {
      li {
        height: 24px;
        line-height: 24px;
      }
    }
  }

  &__total {
    float: left;
    color: $--color-blue-light-3;
    font-size: 13px;

    em {
      color: $--color-primary;
      min-width: 0;
      font-style: normal;
    }
  }

  // 带背景的
  &.is-background {

    .btn-prev,
    .btn-next,
    .el-pager li {
      min-width: 24px;
      font-weight: normal;
      background: $--argument-transparent;
      border: $--border-width-base $--border-style-base $--border-color-base;

      &:not(.disabled).active {
        background-color: $--color-primary;
        border: 0;
      }
    }

    .el-pagination__jump {
      margin-left: 0;
    }

    .el-pagination__editor {
      transform: translateY(-1px);
    }
  }

  // 小尺寸
  &--small {
    font-weight: normal;
  }
}

/* Input
-------------------------- */

input[type="text"] {
  -webkit-appearance: none;
  background-color: $--color-white;
  background-image: none;
  border-radius: 3px;
  border: 1px solid $--border-color-base;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  color: $--color-text-form;
  display: inline-block;
  height: 30px;
  line-height: 30px;
  outline: 0;
  padding: 0 15px;

  &:hover {
    border-color: $--color-text-grade-4;
  }

  &:focus {
    border-color: $--color-primary;
  }

  &::placeholder {
    color: $--color-text-grade-4;
  }
}

// 密码
input[type="password"] {
  height: 30px;
  line-height: 30px;

  +.el-input__suffix {
    .el-icon-view {
      font-family: "iconfont" !important;
      font-size: 14px;
      font-style: normal;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;

      &:before {
        content: "\e601";
      }
    }
  }
}

.el-input {

  &__inner {
    font-size: 12px;
    border-radius: 3px;
  }

  &--prefix {

    // 不在form表单中
    >.el-input__inner {
      padding-left: 10px;
    }

    >.el-input__suffix {
      right: 25px;
    }
  }

  &__icon {
    line-height: 30px;
    cursor: pointer;
  }

  &__prefix {
    left: unset;
    right: 5px;
  }

  &__suffix {
    right: 5px;
  }
}


.el-textarea {
  &__inner {
    font-size: 12px;
    color: $--color-text-form;
  }
}

/* InputNumber
-------------------------- */
.el-input-number {
  line-height: 28px;

  .el-input {
    width: 100%;
  }

  &--medium {
    line-height: 28px;
  }

  &--small {
    line-height: 28px;
  }

  &--mini {
    line-height: 24px;
  }
}

/* DatePicker
---------------------------- */
.el-date-editor {

  &.el-input--large {
    .el-input__inner {
      height: 36px;
      line-height: 36px;
    }
  }

  &.el-input--small {
    .el-input__inner {
      height: 32px;
      line-height: 32px;
    }
  }

  &.el-input--mini {
    .el-input__inner {
      height: 24px;
      line-height: 24px;
    }
  }

  .el-range-separator {
    margin-bottom: 8px;
    padding: 0;
  }

  .el-range__icon {
    line-height: 25px;
  }
}

/* Select
-------------------------- */
.el-select {
  .el-input__inner {
    border: 1px solid $--border-color-base;
  }

  .el-tag {
    height: 24px;
    line-height: 24px;
  }

  &:hover,
  &:active,
  &:focus {
    .el-input__inner {
      border: 1px solid $--color-primary;
    }
  }

  &-dropdown__item {
    text-indent: 2em;
  }

  &-dropdown__empty {
    color: $--color-text-placeholder;
  }

  &-dropdown__list {
    padding: 10px 0;

    &-dropdown__item {
      font-size: 12px;

      &.selected,
      &:hover {
        box-shadow: 2px 0 0 $--color-primary inset;
        background-color: $--color-primary-3;
      }
    }
  }
}


/* Switch
-------------------------- */
.el-switch {
  &__label {
    color: $--color-primary;

    &.is-active {
      color: $--color-warning;
    }
  }

  &__core {
    width: 27px !important;
    height: 16px !important;
    border-color: $--color-warning !important;
    background-color: $--color-warning !important;

    &:after {
      top: -1px !important;
      left: 0;
      box-shadow: 0 2px 4px #d6d6d6;
    }
  }

  &.is-checked {
    .el-switch__core {
      border-color: $--color-primary !important;
      background-color: $--color-primary !important;

      &::after {
        margin-left: -15px;
      }
    }
  }
}

.text-style {
  .el-switch__label {
    transform: scale(0.9);

    &--left {
      color: transparent;
      z-index: 2;
      position: absolute;
      left: 17px;
      width: 28px;

      &.is-active {
        color: $--color-white;
      }
    }

    &--right {
      right: 14px;
      position: absolute;
      width: 28px;
      z-index: 2;
      color: transparent;

      &.is-active {
        color: $--color-white;
      }
    }
  }

  .el-switch__core {
    width: 45px !important;
    height: 21px !important;

    &:after {
      top: 1px !important;
      left: 1px;
    }
  }

  &.is-checked {
    .el-switch__core:after {
      margin-left: -16px;
    }
  }
}

/* Radio
-------------------------- */
.el-radio+.el-radio {
  margin-left: 12px;
}

/* Upload
-------------------------- */
.el-upload {
  &+&__tip {
    color: $--color-primary;
    margin-left: 10px;

    .el-icon-info {
      margin-right: 3px;
    }
  }

  &-list {
    &__item {
      max-width: 400px;
      padding: 5px 15px;
      background-color: $--color-grayish-6;

      &-status-label {
        right: 15px;
        top: 5px;
      }

      .el-icon-close {
        top: 10px;
        right: 15px;
        color: $--color-primary;
        padding: 1px;
        font-size: 12px;
      }

      &:hover {
        .el-icon-close {
          background: $--color-primary;
          border-radius: 50%;
          color: $--color-white;
        }
      }
    }

    &__item-name {
      color: $--color-primary;

      .el-icon-document {
        color: $--color-primary;
        font-size: 14px;
      }
    }
  }

}

.avatar-uploader {
  &:hover {
    background-color: $--color-primary-4;

    >p {
      color: $--color-primary;
    }
  }

  &-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }

  .avatar {
    display: block;
    top: 18px;
    position: absolute;
    left: 12px;
  }

  .el-upload {
    width: 100px;
    height: 100px;
    border: 1px dashed $--border-color-base;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;

    >p {
      position: absolute;
      top: 65px;
      left: 32px;
      font-size: 12px;
      color: $--color-text-form;
    }
  }

  .el-upload__tip {
    display: inline-block;
    height: 100px;
    vertical-align: text-bottom;
    padding-top: 15px;
    padding-left: 20px;

    p {
      color: $--color-primary !important;
      margin-left: 10px;

      .el-icon-info {
        margin-right: 0;
      }

      .el-icon {
        margin-right: 18px;
      }
    }
  }
}

/* Form
-------------------------- */
.el-form-item {

  &__label,
  &__content {
    line-height: 30px;
  }
}

/* DropDown
-------------------------- */
.el-dropdown-menu,
.el-select-dropdown {

  .el-dropdown-menu__item,
  .el-select-dropdown__item {
    &:hover {
      background-color: $--color-primary-3;
      box-shadow: 2px 0 0 $--color-primary inset;
    }

    &.danger-style {
      background-color: transparent;
      color: $--color-danger;

      &:hover {
        background-color: $--color-danger-3 !important;
        box-shadow: 2px 0 0 $--color-danger inset;
        color: $--color-danger;
      }
    }
  }
}

/* Tooltip
-------------------------- */
.el-tooltip__popper {
  &-danger {
    color: $--color-danger !important;
  }

  &.is-dark {
    background-color: #2d2d44;
    padding-left: 28px;
    padding-right: 28px;
    color: white;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba($color: $--color-text-grade-1, $alpha: 0.1);

    &[x-placement^="right"] {
      padding-left: 14px;
      padding-right: 14px;
    }

    &[x-placement^="top"] .popper__arrow {
      border-top-color: $--border-color-base;

      &::after {
        border-top-color: $--color-white;
      }
    }

    &[x-placement^="right"] .popper__arrow {
      border-right-color: $--border-color-base;

      &::after {
        border-right-color: $--color-white;
      }
    }

    &[x-placement^="bottom"] .popper__arrow {
      border-bottom-color: $--border-color-base;

      &::after {
        border-bottom-color: $--color-white;
      }
    }

    &[x-placement^="left"] .popper__arrow {
      border-left-color: $--border-color-base;

      &::after {
        border-left-color: $--color-white;
      }
    }
  }
}

/* ScrollBar
-------------------------- */
.el-scrollbar {
  .el-scrollbar__wrap {
    overflow-x: hidden;
  }
}


/* Dialog
-------------------------- */
.v-modal {
  opacity: 0.77;
  background-color: $--color-blue-deep-1;
}

.el-dialog {
  &__title {
    font-size: 16px;
    color: $--color-text-primary;
  }

  &__close {
    font-size: 18px;
    color: $--color-text-primary;
    font-weight: bold;
  }

  &__footer {
    text-align: center;

    .el-button+.el-button {
      margin-left: 20px;
    }
  }
}

/* Alert
--------------------------- */

.el-alert {

  &+.el-alert {
    margin-top: 20px;
  }

  &__content {
    line-height: 1;
  }

  &--info {
    &.is-light {
      height: 36px;
      line-height: 36px;
      border-radius: 3px;
      border: 1px solid $--color-primary-2;
      background-color: $--color-grayish-6;
      color: $--color-primary;
    }
  }

  &--warning {
    &.is-light {
      height: 36px;
      line-height: 36px;
      border-radius: 3px;
      border: 1px solid $--color-danger-2;
      background-color: $--color-danger-3;
      color: $--color-danger;
    }
  }
}

/* Message
-------------------------- */
.el-message {
  &--info {
    background-color: $--color-primary-3;
    border-color: $--color-primary-2;

    .el-message__icon,
    .el-message__content {
      color: $--color-primary;
    }
  }

  &--success {
    background-color: $--color-success-3;
    border-color: $--color-success-2;

    .el-message__icon,
    .el-message__content {
      color: $--color-success-1;
    }
  }

  &--warning {
    background-color: $--color-warning-3;
    border-color: $--color-warning-2;

    .el-message__icon,
    .el-message__content {
      color: $--color-warning;
    }
  }

  &--error {
    background-color: $--color-danger-3;
    border-color: $--color-danger-2;

    .el-message__icon,
    .el-message__content {
      color: $--color-danger;
    }
  }
}

/* MessageBox  :not(.el-message-box--center)
-------------------------- */

.el-message-box {
  box-shadow: none;

  &__title {
    >span {
      font-weight: normal;
      color: $--color-text-grade-1;
    }
  }

  &__headerbtn {
    font-size: 22px !important;
  }

  &__container {
    display: flex;
  }

  &__content {
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }

  &__status {
    font-size: 32px !important;
    position: static;
    transform: none;
    font-family: "iconfont" !important;
    font-style: normal;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateY(4px);

    &.el-icon-error {
      &::before {
        content: "\e6f7";
      }
    }

    &.el-icon-warning {
      &::before {
        content: "\e6fb";
      }
    }

    &.el-icon-success {
      &::before {
        content: "\e65c";
      }
    }

    &.el-icon-info {
      &::before {
        content: "\e6fd";
      }
    }
  }

  &__message {
    padding: 0 0 0 18px !important;

    p {
      line-height: 24px;
      display: table;
      font-size: 14px;
      color: $--layout-tabs-text-color;

      &:nth-child(1) {
        font-size: 20px;
        line-height: 30px;
        color: $--color-text-primary;
      }
    }
  }

  &__btns {
    text-align: center;

    .el-button {
      padding: 8px 12px;

      &:not(.el-button--primary) {
        background-color: $--color-grayish-1;
        border-color: $--border-color-base;
        color: $--color-danger;

        &:hover,
        &:active,
        &:focus,
        &:visited {
          background-color: $--color-danger-hover;
          border-color: $--color-danger-foucs;
          color: $--color-white;
        }

        &.is-disabled {
          background-color: $--border-color-base;
          border-color: $--border-color-base;
          color: $--color-danger;

          &:hover {
            background-color: $--border-color-base;
            border-color: $--border-color-base;
            color: $--color-danger;
          }
        }
      }
    }
  }
}

/* Notification
-------------------------- */
.el-notification {
  border-radius: 3px;
  box-shadow: none;
  background-color: $--color-primary-3;
  border-color: $--color-primary-2;

/*  .el-notification__icon,
  .el-notification__title,
  .el-notification__content {
    color: $--color-primary;
  }*/

  &.custom-info {
    background-color: $--color-primary-3;
    border-color: $--color-primary-2;

    .el-notification__icon,
    .el-notification__title,
    .el-notification__content {
      color: $--color-primary;
    }
  }

  &.custom-success {
    background-color: $--color-success-3;
    border-color: $--color-success-2;

    .el-notification__icon,
    .el-notification__title,
    .el-notification__content {
      color: $--color-success-1;
    }
  }

  &.custom-warning {
    background-color: $--color-warning-3;
    border-color: $--color-warning-2;

    .el-notification__icon,
    .el-notification__title,
    .el-notification__content {
      color: $--color-warning;
    }
  }

  &.custom-error {
    background-color: $--color-danger-3;
    border-color: $--color-danger-2;

    .el-notification__icon,
    .el-notification__title,
    .el-notification__content {
      color: $--color-danger;
    }
  }
}


/* Drawer
-------------------------- */
.el-drawer {
  box-shadow: 0 3px 7px rgba($color: #000000, $alpha: 0.1);

  &__header {
    font-size: 14px;
    font-weight: normal;
    color: $--color-text-primary;
    background: $--color-primary-2;
    padding: 6px 0 6px 20px;
    margin-bottom: 0;

    span:focus {
      outline: none;
    }
  }

  &__body {
    font-size: 14px;
    color: $--color-text-grade-2;
    padding: 20px;
    background-color: $--color-grayish-6;

  }
}